﻿/* ================================================================================
<copyright file="ExceptionRendererTest.cs" company="The Framework Factory, LLC" lastWriteTime="12/05/2012 23:23:47 PM">
  Copyright (c) 2012 The Framework Factory, LLC.  All rights reserved.
</copyright>
=================================================================================== */
using System;
using System.IO;
using System.Text;

using NUnit.Framework;

using log4net.ObjectRenderer;

namespace FWF.Logging.Test
{
    /// <summary>
    /// 
    /// </summary>
    [TestFixture]
    public class ExceptionRendererTest
    {

        /// <summary>
        /// Renders the object.
        /// </summary>
        [Test]
        public void RenderObject()
        {
            var exceptionRenderer = new ExceptionRenderer();
            var rendererMap = new RendererMap();

            Exception ex = new InvalidOperationException( "This is a message", new ArgumentNullException( "paramName" ) );

            var stringBuilder = new StringBuilder();

            using ( var stringWriter = new StringWriter( stringBuilder ) )
            {
                exceptionRenderer.RenderObject( rendererMap, ex, stringWriter );
            }

            Assert.Greater( stringBuilder.Length, 0 );
        }

    }
}
